import React from 'react'
import {useParams} from 'react-router-dom'
import {useSelector,useDispatch} from 'react-redux'
import style from './detail.module.css'
import { delDate,addDate } from '../../store/dateSlice'
const Index = () => {
  let dispatch = useDispatch()
  const {id} =useParams()
  console.log(id)
  const {date} = useSelector((state)=>state.dateSlice)
  console.log(date)
  return (
    <div>
      <p className={style.box}>
        <span onClick={()=>dispatch(delDate())}>前一天</span>
        <span>{date}</span>
        <span onClick={()=>dispatch(addDate())}>后一天</span>
      </p>
    </div>
  )
}

export default Index
